<form class="layui-form" action="{:url()}" method="post" id="editForm">
    
    {:FormExt::input('外包工厂名称', 'name', '', '请输入工厂名称', 'required', 'lay-verify="required"')}
    <label class="layui-form-label">所属工厂</label>
    <div class="layui-input-inline">
        <select name="factory_ids" lay-filter="factory" xm-select="method-value-example1">
            <option value=""></option>
            {volist name="factoryKV" id="key"}
            <option class="opt" value="{$key}">{$factoryKV[$key]}</option>
            {/volist}
        </select>
    </div>
    {:FormExt::input('工厂地址', 'address', '', '请输入工厂地址', '', 'lay-verify="required"')}
    {:FormExt::input('联系电话', 'mobile', '', '请输入联系电话', '', 'lay-verify="required"')}       
<!--    {:FormExt::select('工厂名称', 'factory_id', '' , [0 => '未分配'] + getFactoryKV(true), 'factory-ids', 'layui-input','lay-search="" lay-filter="factoryIds" lay-verify="required" ')}-->
    
<!--    {:FormExt::input('唯一编码号', 'code', '', '请输入唯一编码号', 'required', 'lay-verify="required"')}-->

    <div class="pop-bottom-bar">
    	<input type="hidden" class="field-id" name="id">
        <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit" hisi-data="{pop: true, refresh: true}">提交保存</button>
        <a href="javascript:parent.layui.layer.closeAll();" class="layui-btn layui-btn-primary ml10">取消</a>
    </div>
</form>

{include file="system@block/layui" /}
    
<script>
    var formData = {:json_encode($formData)};
    layui.use(['form', 'func','formSelects'], function() {
        var $ = layui.jquery, form = layui.form,formSelects=layui.formSelects;
        layui.func.assign(formData);
        {if (isset($formData['factory_ids']))}
        formSelects.value('method-value-example1', [{$formData['factory_ids']}]);
        {/if}
    });
</script>